# -*- coding: utf-8 -*-
from odoo import models, fields, api

class PriceListSaleOrder(models.Model):
    _inherit = 'sale.order'

    compute_totoal_amount = fields.Monetary(string='總價', compute='set_sale_order_total')

    def set_sale_order_total(self):
        for line in self:
            total=0
            for row in line.order_line:
                total += row.price_unit * row.product_uom_qty
            line.compute_totoal_amount = total